<div id="sArticle">


    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">文章管理操作</div>
        <div class="panel-body">
            <div class="pull-left"  bs-drop-button p-button-class="btn-default" p-button="排序 {{query.sort}}" p-id="control_sort">
                <li><a  ng-click="changeLimit('sort','article_id')">文章ID</a></li>
                <li><a  ng-click="changeLimit('sort','article_click')">文章点击量</a></li>
                <li><a  ng-click="changeLimit('sort','article_reply')">文章评论数</a></li>
            </div>
            <div style="margin-left: 5px;" class="pull-left"  bs-drop-button p-button-class="btn-success" p-button="分类 {{query.class}}" p-id="control_class">
                <li><a  ng-click="changeLimit('class',null)" >所有类别</a></li>
                <li ng-repeat="single in articleClass ">

                    <a  ng-click="changeLimit('class',single.class_id)" >{{single.class_name}}</a>
                </li>

            </div>
            <div class="pull-left" style="padding-left: 5px;padding-top: 5px">
                <label>倒序</label> <input type="checkbox" ng-checked="query.desc" ng-click="desc()">
            </div>
            <div class="pull-right">

                <input type="text" ng-model="search" class="form-control" style="float: left;width:150px">
                <button style="margin-left: 5px" ng-click="changeLimit('search', search)" class="btn btn-primary" >搜索</button>
            </div>

        </div>

        <table class="table table-hover">
           <tr>
               <th>ID</th>
               <th>文章标题</th>
               <th>文章分类</th>
               <th>创建时间</th>
               <th>文章用户</th>
               <th>点击量</th>
               <th>收藏数</th>
               <th>操作</th>

           </tr>

            <tr class=" article_item" ng-repeat="single in articleData">
                <td>{{single.article_id}}</td>
                <td>{{single.article_title}}</td>
                <td>{{single.class_name}}</td>
                <td>{{single.article_create_date}}</td>
                <td>{{single.article_user}}</td>
                <td>{{single.article_click}}</td>
                <td>{{single.article_star}}</td>
                <td>
                    <div class="pull-left" bs-modal p-id="more_{{single.article_id}}" p-button="详情" p-button-class="btn-default" p-title="详情">
                        ID:{{single.article_id}}<br>
                        标题：{{single.article_title}}<br>
                        分类：{{single.class_name}}<br>
                        创建时间：{{single.article_create_date}}<br>
                        文章用户：{{single.article_user}}<br>
                        点击量：{{single.article_click}}<br>
                        收藏量：{{single.article_star}}<br>
                        介绍：{{single.article_intro}}<br>
                        详情：<a href="/index_articleDetail/{{single.article_id}}" class="btn btn-default btn-xs">点击此跳转至文章页面</a><br>

                    </div >
                    <div class="pull-left" bs-modal p-id="del_{{single.article_id}}" p-button="删除" p-button-class="btn-danger" p-title="删除">
                        <p>
                            <h3>确认删除文章 {{single.article_title}}</h3>
                        </p>
                        <br><a href="" ng-click="deleteArticle(single.article_id)" class="btn btn-danger">删除</a>
                    </div>

                    <div class="pull-left" bs-modal p-id="label_{{single.article_id}}" p-button="标签" p-button-class="btn-info" p-title="标签">
                        <h3>已有标签</h3>
                        <a  class="btn btn-xs " ng-repeat="value in single.labels"
                                ng-click="deleteLabel(value.label_id,single.article_id)">
                            {{value.label_name}}
                            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                        </a>

                    </div>

                    <div class="pull-left" bs-modal p-id="class_{{single.article_id}}" p-button="指定分类" p-button-class="btn-primary" p-title="分类">
                        <h3>指定分类</h3>
                        <label><input type="radio" ng-click="changeClass(single.article_id)"> 空</label><br>
                        <label style="display: block;" ng-repeat="value in articleClass"><input type="radio" ng-click="changeClass(single.article_id,value.class_id)"

                                      ng-checked="value.class_id == single.article_class">
                            {{value.class_name}}
                        </label>


                    </div>

                </td>
            </tr>
        </table>
        <div class="panel-footer">
            当前第 {{ nowPage }} 页 | 总计 {{ total }} 页
            <ul class="pager">
                <li><a ng-if="nowPage>1"
                       href="" ng-click="previousPage()">前一页</a></li>

                <li><a ng-if="nowPage<total"
                       href="" ng-click="nextPage()">下一页</a></li>
            </ul>
        </div>

    </div>
</div>
